package com.prs.crm.dao.cdxh.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.prs.crm.dao.cdxh.ReDispationDao;
import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.domain.cdxh.ReDispation;
import com.prs.crm.domain.cdxh.wages.MoldingWages;

public class ReDispationDaoImpl extends BaseDaoImpl<ReDispation> implements
		ReDispationDao {

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@Override
	public List<ReDispation> getReDispationWages(final String name) {
		return (List<ReDispation>) this.getHibernateTemplate().execute(
				new HibernateCallback() {
					public Object doInHibernate(Session session)
							throws HibernateException {
						Criteria criteria = session
								.createCriteria(ReDispation.class);
						criteria.add(Restrictions.eq("proName", name));
						List<ReDispation> result = criteria.list();

						return result;

					}
				});
	}

}
